Cleaning up the code, removing orphans