made code a little bit more idiomatic scala