Simplify alignment code