Code cleanup and removal of broken functionality.