Cleaned up the some code