Refactored preferences into own module