Refactory by remove unnessary code