Swtiched from returning null to IllegalStateExceptions, cleaned up unused code