Erlang helpers and utility functions