constify
unused function
code dedup