Refactoring. Moved all business logic to service layer