Refactored with methods