refactoring public functions
refactoring