refactor label follow to avoid gotos