Refactored alot of code

reduced overall & max complexity