moving things around to common the code
still not working