Using mock for testing