Cleaning up, splitting to modules