Cleaning up functions to use underscoreJS