1. add result;
2. some minor refactor;