Some code refactoring and improvments