Refactory part 1