Refactored some parts to allow custom setting editors in the future.