Move functions

Several functions got moved outside of discuss due to my whitespace
normalizer getting confused, which broke everything.