The old code is shameful ;) That was my first baby steps in scala :(