added permissions + roles, refactoring, javadocs