refactor align code