Added some improvements that reduce the whole code size