moving out method to be easier to read