sanity checks and code cleanup
preparing for version 0.1.4