Move data operations to methods