move register to a static method