Added compat utils for correct use of deprecated methods.
Use single int for storing of indicies.
Make variables final if they don't need to be changed.