Modularise and restructure