Refactoring some code

Signed-off-by: Ken <vul3yo6@hotmail.com>