Tested complete flow and refactoring