Use layout instead of encoder