use function instead of constant