refactored some stuff.