refactor on layout