Serious cleanup of code

Removing unnecessary code