cleaned up overall structure