fixed settings, code clean up