Refactored uptime formatting and string truncating