reworked metrics functions and UI