structure the creation of the handles and setting the states a little more