Refactoring, more analysis