refactor to module program with requirejs