Why not refactor `get_free_space` instead of needlessly duplicating code?