Added generic types to some methods for a cleaner api.