Simplify implementation. Closes #24.