moved 'constants' from global scope into directive