updating refactored version