Giant refactor of code

removed stupid code style