modularise code