refine layout calculator