Updated to use methods instead of channels.