cleaned up fluid code