register fragment & code cleanup