Using specification to improve event hook