moved layout checking to new function
    -> to limit visible variables in layout file