Move to main class instead of a lone function.