Improve layout logic
fix