FIX: Clean up the code to address @jnothman's comments on github.