Bring back mocking in layout, add env flag