Refactored to exclude Java 8 API calls
Bug fixes