Refactored into more methods