Use better way of handling different states inside widget