Refactored function to extract tests to private function
Fixed some bugs and now using updated ee() call