add helper functions to fetch user IDs and rename pre/post to before/after