minor code refactoring
Merge pull request #40 from Atheros1/master

minor code refactoring