extract state extraction into method
extract state and number extraction into method
use attr_accessor correctly