refactored to common