Add function to get non rect reg

Add function to get non rect reg
and fix the folder structure and
some unnecessary lines of code