Refactor, cleanup, remove outdated