Prefer use constant instead of dynamic variables

Related to #339