fixup! fixup! fixup! fixup! Refactor and improvements