Reading the variable names and the comments doesn't make it clear to me what they do. Might just be because I don't understand the  subsite module that well.