Although I don't like it, the Erlang convention is to separate private functions from the gen_server callbacks. For consistency with this code these should move to the Private Functions sections.