Refactoring to allow for more input types