ticket:3 enhanced tests
ticket:3 enhanced middleware