refactoring contd..