refactor create control by using jquery