Add layout handling and configuration option