Move functions into program module