changes for performance improvement from Android port
License