broken code before refactor