cleaning up code, spread code over several files