remove/merge a lot of code