refactor analysis