fix issues 114 and cleanup