did some design updates and fixed some exception handling