Revert "Less hacky solution"

This reverts commit ab82dc42c06e6335619577e58a4bccabe73b098b.