15th update --- refactoring functionality