minor refactoring for better performance and added additional attributes from Identity