Refactor madness, nothing working yet