Cleaned up the code

General cleaning up of left over and unused code