refactor and add next method