Refactored to streamline and remove extra arguments that aren't really needed.