updated some naming conventions, moved helpers and hacks to state file