refactor csrf example