* Less code and logic duplication. * Fixes a bug with the data dir not being created, steps being done in the wrong order.