Removed unused variable.
Switched to using IllegalStateException instead of RuntimeException
Should throw proper exceptions, not Exception
Should throw proper exceptions, not Exception