Big refactoring after trying to make usage example smaller.