Revert "Ugly code"

This reverts commit 5a3cf2893ad948a7228d0dbe948da63d456fa989.