Move hooks to env and test to integration