refacto handling of user resource