refactor, just changed the order of the methods