Moving code to module