refactor brainfuck