clean up analyze method