refactored few things