Refactor layout variable in generic app