change IllegalStateException to NoSuchElementException
reorganize packages and sources