add hooks to fake
extract common code to base