Made river code even more cleaner