rearrange code in rpush.rb