Started refactoring (services layer for testing)