put goto into separate class