Change usage of `self = this` to use arrow functions instead