Refactory Code