Removed one-time-use functions, added reusable functions.