fix #41, also did a cleanup