Erlang useful functions