See commit messages, fixes #1, #4 as well as some design improvements