concentrate logic in one place