cleanup a bit, still needs a lot of work