Minor refactoring
Minor code refactoring