refactored logic out to make code more clear

cleaned up that one method