Codecleanup

One hell of a cleanup