Refactored to methods