streamlining and code cleanup