Fixed repository, added new domain logic classes and tests