Refactored and started tests