Improve code a little bit. Thanks again to Vladimir

(based on commit a84b68f)

Signed-off-by: Xfurry <xfurry@scriptdev2.com>