Building register logic