Refactored some stuff
Minor changes