Applying some of the changes by Victor Häggqvist