Remove dead code and reformat utility functions for statusline