Code canocalization.

Be smart. Pack up parameters which belong together to simplify the passing of data in the system.

Identify places where it will be better to pass structure and unpack inside the function rather at the
top-level.

Use a more idiomatic Erlang style in the state code.

Identify numerous large functions which should take an update or two.