Refactored alot
lots of refacture