Putting some common code in common.js