all refactored