merging Facebook connect code