moves reusable code to module