Cleanup of extraneous code and better labeling