Removed system outs and refactored tests