cleanups and change in architecture