refactoy helper