start refactor of quiz javascript