Analysis improvements. Refactoring.