Use "self" instead of this for nested functions