Refactor label engine module