Fix code disadvantages according to @tadatuta notations