added layout and scale to refactor