Completed refactoring the codebase, separting concerns