Refactor on layout