Refactored unittest, a bit more coverage is necessary but it's time for a coffee break.