Cleaned up unneeded code and some polishing