Refactor content script, which also based on angular