remove usage of instance variables where possible