Need to refactor