Added support for preferences