rename function for clarity, formatting improvements