refactored add