Refactors

Hey, ive refactored bits and peices. Beware it is all untested.