Cleaned up code to reflect conventions