Improve user and permission repositories