slightly less hacky but still hacky