refactored mymethod