refactoring. now app support AMD and requirejs