refactored few
minor modification