grid positioning refactored