removed some erlang style if statements