refactor based on feedback