replace dead code with a todo
refactor spaghetti code to use named functions