refactor to remove "continue;"