refactored define