Seperated some code into a simpler molecule class