refactored versions