hook everything together correctly, remove intermediate hook function