refactor code; distribute as 0.1.2