Refactors options/settings handling