clean up inherit function