it's a bad style to return different object types from function depending on it input