Clean up and some simplifications