Added unit tests and refactored based on results from mutant