Refactoring and added Javascript manifest