unit tests for all remaining characters, minor refactoring