streamlining homepage code