Convert to module pattern to get under 20 lines