Update common-functions.js

cleaned up the indentation and spacing