Cleaning up gravity.js