refactoring few things