refactor, simplified