Improve register setting functions