Code refactor and UI streamlining