Revert "updating hooks to have context and post/pre done in correct env"

This reverts commit 1887cb4f0ab4327996638d1b2f1c4a6628f29c2e.