refactored helper for better code syle