#21

And slight code improvements