futher code improvements