setup rspec and console
finish extracting middleware