Extract handling to helper methods