rewrite to use method receivers and get rid of extraneous elements