Further code cleanup tweaks

Signed-off-by: ziycon <ziycon.eire@gmail.com>
Merge pull request #2015 from ziycon/further_code_cleanup

Further code cleanup tweaks