refactor to remove jquery