Cleanup and removal of old code