break up massive class
fix npe