Refactored state options and little api fixes