Code improvements branch

Minor code improvements (fixed usages of deprecated APIs, attributes marked final where possible, getters used instead of accessing attributes directly, ...)