Refactored how configuration is handled

See #78