refactor render content into separate method