user preferences (fixes #10), refactoring