Refactor code and add identity role repo