finished functionality (TODO: tests, persist messages)