Reducing number of method calls