refactoring - moved to appropriate place