Improved register logic, got rid of preferences