Rewrite this shit from scratch [ci skip]