Move fields into functions