refactor simplifies render improves readability