refactoring mutliple line error