system preferences code refactoring
System preferences refactoring