base code for settting