Refactor the following custom ring middleware: simple logging and http options filter.