added tests for roles, added idea for factory and repository