Cleaned up and removed uneeded code