rewrite because it's ugly and to prepare for mjolnir