#214 code cleanup, new version