Refactor - extract validation