combine two method to one