fix handler creation
add state generation and model