Abstraction and optimization

Technical debt