move register template to new folder
scrutinizer fixes
make type safe
rm unneeded code