refactor using continue