Finished modularisation of part 3