make the internal state change function local

Also changed its name to reduce confusion about which function is being called. Actually this refactors quite a bit again.
refactored for readability

A mate of mine kinda cringed at the shorthand.