refactored to use instance variable of current user