just add a little bit code refactoring

Hi, @jazzychad please review this...