Extract helper methods to module