Some code refactoring
Some code refactoring