FIXME: this looks even more shit...