refactory layout