Make hacky solution less hacky