code refactory