Rewritten some part of code.