refactor logger and add uitls.js