split fat code in separate files