Cleaned up layout management.