Clean up implementation to match tests