Moving code from message bottle