code refactory;