small refactor + freezing definitions