Refactored method to accept custom input ids