refactor stuff, but still does not word