Optimize code (remove loading config from file, replace instance variables with local ones)