less hacky approach