refactored methods and variables