extract helper methods