refactor constants and small cleanup