javadoc, and state machine implementation