refactory for better layout