Cleaned up some minor code