fix inheritance constructor
add conditions before method calls
set initialized flag before init method
remove inheritance from state class