refactored common