minor cleanups
added basic tests