added support for different layouts