add executeJavaScript method to manager, improve coding style