moved utils.js to lib, code cleanup.