updated and refactored methods