Refactoring and checking finish state