add option to supply own init function
add checks