Separated to modules and improved resource registration technique.