Cleanup of code

Removed various sections of code which were no longer used