Refactored method to improve reutilization