fix #148. And "base" refactoring
fix #151