Additional Tests and Refactoring