refactor set_malign