move metadata (user & date) finding functions to middleware