Extract usernameFromReq method
Add test that changing the request struct doesn't affect logging
Extract struct from a bunch of local vars