code before removing Layout