refactored for use of continue in statement