almost half modularised code