refactored common.js code more