Refactor solution to make it modular