improving internal code