Refactored Select method to return dynamic types