Refactor with Namespace, still needs cleaning