Removing unused code. Some cleanup