Cleaning code and removing dependences