Added ability to change layouts on the fly