Refactored code in various methods