refactoring and small chages