Some optimizations.

Signed-off-by: AndroWiiid <androwiiid@gmail.com>