Moved message factory to application