Optimize framework's js codes