Some slight refactoring for swiftiness