refactored to reduce visibility