pls refactor it. Remove else from  for statement